import cv2

faceClassifier=cv2.CascadeClassifier('D:\OpenCV\opencv\sources\data\haarcascades\haarcascade_frontalface_default.xml')
objImage=cv2.imread('D:\GitHUb\MyMayun\Firstmayun\test.jpg')


    
dst = cv2.resize(objImage, (1200,1200), interpolation = cv2.INTER_CUBIC)
cvtImage=cv2.cvtColor(dst,cv2.COLOR_BGR2GRAY)
foundFaces=faceClassifier.detectMultiScale(cvtImage,scaleFactor=1.2,minNeighbors=15,minSize=(50,50))
print("Found {0} faces".format(len(foundFaces)))

for (x,y,w,h) in foundFaces:
    cv2.rectangle(dst,(x,y),(x+w,y+h),(0,255,0),2)
detectResult=str(len(foundFaces))+' faces detected'
cv2.imshow(detectResult, dst)
cv2.waitKey(0)

#cv2.destroyAllWindows()
